import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
	{
		path: '/',
		component: () => import('@/pages/index.vue'),
		redirect: '/workspace',
		children: [
			{
				path: '/workspace',
				component: () => import('@/pages/workspace/index.vue'),
			},
			{
				path: '/system/roles',
				component: () => import('@/pages/system/roles/index.vue'),
			},
			{
				path: '/system/users',
				component: () => import('@/pages/system/users/index.vue'),
			},
			{
				path: '/userinfo',
				component: () => import('@/pages/system/users/info.vue'),
			},
			{
				path: '/system/menu',
				component: () => import('@/pages/system/menu/index.vue'),
			},
			{
				path: '/blog/list',
				component: () => import('@/pages/blog/index.vue'),
			},
			{
				path: '/blog/write',
				component: () => import('@/pages/blog/write.vue'),
			},
		],
	},
	{
		path: '/login',
		component: () => import('@/pages/login/index.vue'),
	},
]

const router = createRouter({
	history: createWebHashHistory(),
	routes,
})

export default router
